package com.ruoyi.controller;

import com.ruoyi.domain.Num;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.*;

/**
 * @author 24466
 * @date 2024/10/19 17:42
 */
@RestController
@RefreshScope
public class HelloController {

    @Value("${lesson05.name}")
    private String name;

    @GetMapping("/server/config/hello")
    public String hello(){
        return "Config: " + name ;
    }

    @GetMapping("/server/config")
    public String getName(@RequestParam("number") String number,@RequestParam("count")String count){
        return "number: " + number + ", count: " + count ;
    }

    @PostMapping("/server/post")
    public String postName(@RequestBody Num num){
        return "number: " + num.getNumber() + ", count: " + num.getCount() ;
    }
}

